package com.wing.cabinet.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wing.cabinet.model.entity.Cabinet;
import com.wing.cabinet.model.response.CabinetVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 刀柜-Dao
 *
 * @author
 */
@Mapper
public interface CabinetDao extends BaseMapper<Cabinet> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<CabinetVO> list4app(@Param("params") Map<String, Object> params);

    List<CabinetVO> list4app(@Param("page") Page<CabinetVO> page, @Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<CabinetVO> inventory(@Param("page") Page<CabinetVO> page, @Param("params") Map<String, Object> params);


    /**
     * 我的库存 -app
     */
    CabinetVO myInventory(@Param("cabCode") String cabCode,@Param("cabinetNature") String cabinetNature);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    CabinetVO get4appById(Long id);

    CabinetVO get4appByCode(String code);

    CabinetVO getMainCab4appByCode(String code);


    /**
     * 修改主柜
     * @param params
     * @return
     */
    int updateCompanyByMain(@Param("params") Map<String, Object> params);

    /**
     * 修改副柜
     * @param params
     * @return
     */
    int updateCompanyByAuxiliary(@Param("params") Map<String, Object> params);

    int updateCompany(Map<String, Object> params);

    List<CabinetVO> getCabinetByCabCode(String cabCode);

    /**
     * 查询所有主柜
     * @return
     */
    List<CabinetVO> getCabinetByCabinetNature();

    void updateWorkshop(@Param("belongCabinet")String belongCabinet, @Param("id")Long workshopId);
}
